{extend name="common:base" /}
{block name="css_file"}
<link rel="stylesheet" href="__ADMIN__/css/bootstrap-datepicker3.min.css" />
{/block}
{block name="content"}
<div class="row">
<form class="form-horizontal" action="{notempty name="userinfo"}{:url('index',['act'=>'update','uid'=>$userinfo.uid])}{else /}{:url('index',['act'=>'update','uid'=>0])}{/notempty}" method="post">
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="username"> 用户名 </label>
    <div class="col-sm-9">

        <input type="text" {notempty name="userinfo"} disabled="disabled" {else /} name="username" {/notempty} id="username" class="col-xs-10 col-sm-5" value="{$userinfo.username ?? ''}">
        <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle">不可修改</span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="form-field-4"> 用户头像 </label>
    <div class="col-sm-9">
        <div class="col-xs-10 col-sm-5">{notempty name="userinfo"}{:UploadImage("avatar",100,100,$userinfo['avatar'])}{else /}{:UploadImage("avatar",100,100,'/static/admin/images/avatars/avatar2.png')}{/notempty}</div>
        <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle">仅支持jpg、gif、png、bmp、jpeg。</span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="ugid"> 用户组 </label>
    <div class="col-sm-9">
    <select id="ugid" name="ugid" class="col-xs-10 col-sm-5">
        {volist name="group" id="val"}
            <option value="{$val.id}"{notempty name="userinfo"}{eq name="$val.id" value="$userinfo.ugid"} selected="selected"{/eq}{/notempty}>{$val.title}</option>
        {/volist}
    </select>
    <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle">用户组</span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="sex"> 姓别 </label>
    <div class="col-sm-9">
        <select id="sex" name="sex" class="multiselect">
            <option value="0"{notempty name="userinfo"}{eq name="$userinfo.sex" value="0"} selected="selected"{/eq}{/notempty}>保密</option>
            <option value="1"{notempty name="userinfo"}{eq name="$userinfo.sex" value="1"} selected="selected"{/eq}{/notempty}>男</option>
            <option value="2"{notempty name="userinfo"}{eq name="$userinfo.sex" value="2"} selected="selected"{/eq}{/notempty}>女</option>
        </select>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="password"> 用户密码 </label>
    <div class="col-sm-9">
        <input type="password" name="password" id="password" placeholder="用户密码" class="col-xs-10 col-sm-5" value="">
        <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle">留空不修改</span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="birthday"> 生日 </label>
    <div class="col-xs-9 col-sm-9">
        <div class="input-group col-xs-5">
            <input class="form-control" id="birthday" name="birthday" value="{notempty name="userinfo"}{$userinfo.birthday|date="Y-m-d"}{/notempty}" type="text" data-date-format="dd-mm-yyyy" />
            <span class="input-group-addon">
                <i class="ace-icon fa fa-calendar bigger-110"></i>
            </span>
        </div>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="tel"> 电话号码 </label>
    <div class="col-sm-9">
        <input type="text" name="tel" id="tel" placeholder="电话号码" class="col-xs-10 col-sm-5" value="{$userinfo.tel ?? ''}">
        <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle"></span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="qq"> Q&nbsp;&nbsp;Q </label>
    <div class="col-sm-9">
        <input type="text" name="qq" id="qq" placeholder="QQ" class="col-xs-10 col-sm-5" value="{$userinfo.qq ?? ''}">
        <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle"></span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="email"> E-mail </label>
    <div class="col-sm-9">
        <input type="email" name="email" id="email" placeholder="E-mail" class="col-xs-10 col-sm-5" value="{$userinfo.email ?? ''}">
        <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle"></span>
        </span>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-1 control-label no-padding-right" for="status"> 用户启用 </label>
    <div class="control-label no-padding-left col-sm-1">
        <label>
            <input name="status" id="status" {notempty name="userinfo"}{eq name="$userinfo.status" value="1"} checked="checked" {else /}{/eq}{else /} checked="checked" {/notempty} value="1" class="ace ace-switch ace-switch-2" type="checkbox" />
            <span class="lbl"></span>
        </label>
    </div>
    <span class="help-inline col-xs-12 col-sm-7">
            <span class="middle"></span>
    </span>
</div>
<div class="space-4"></div>
<div class="col-md-offset-2 col-md-9">
    <button id="submit" class="btn btn-info" type="submit">
        <i class="icon-ok bigger-110"></i>
        提交
    </button>

    &nbsp; &nbsp; &nbsp;
    <button class="btn" type="reset">
        <i class="icon-undo bigger-110"></i>
        重置
    </button>
</div>
</form>
</div>
{/block}
{block name="js_file"}
                <script src="__ADMIN__/js/bootstrap-datepicker.min.js"></script>
                <script src="__ADMIN__/js/bootstrap-datepicker.zh-CN.min.js"></script>
{/block}
{block name="javascript"}
<script type="text/javascript">
    $(function(){
        $('#birthday').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'zh-CN'
         }).next().on(ace.click_event, function(){
            $(this).prev().focus();
        });
    });
</script>
{/block}
